<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery-3.6.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			$(function(){
//				$("button").click(function(){
//					console.log($(this).index());
//				})

//				$("button").on("click",fn);
				$("button").on({"click":fn,"mouseenter":fn2});
				function fn(){
					console.log($(this).index());
				}
				function fn2(){
					console.log("鼠标移入");
				}
				
				//在选择元素上移除一个或多个事件的事件处理函数。
//				$("button").off({"click":fn,"mouseenter":fn2});//多个
				$("button").off();//全部
				
				$(".v1").on("input",function(){
					console.log(1);
				})
			})
		</script>
	</head>
	<body>
		<button>按钮1</button>
		<button>按钮2</button>
		<input class="v1" />
	</body>
</html>
